var appData = require("@/static/json/area.json");
var options = appData.data;
export function getarea(area){
  let i = 0;
  let j = 0;
  let k = 0;
  while (options[i] != null) {
    if (options[i].value == area[0]) {
      area[0] = options[i].label;
      while (options[i].children[j] != null) {
        if (options[i].children[j].value == area[1]) {
          area[1] = options[i].children[j].label;
          while (options[i].children[j].children[k] != null) {
            if (options[i].children[j].children[k].value == area[2]) {
              area[2] = options[i].children[j].children[k].label;
              return area
            }
            k++;
          }
        }
        j++;
      }
    }
    i++;
  }
}
export function setarea(area){
  let i = 0;
  let j = 0;
  let k = 0;
  while (options[i] != null) {
    if (options[i].label == area[0]) {
      area[0] = options[i].value;
      while (options[i].children[j] != null) {
        if (options[i].children[j].label == area[1]) {
          area[1] = options[i].children[j].value;
          while (options[i].children[j].children[k] != null) {
            if (options[i].children[j].children[k].label == area[2]) {
              area[2] = options[i].children[j].children[k].value;
              return area
            }
            k++;
          }
        }
        j++;
      }
    }
    i++;
  }
}
